package com.cn.io.bio;

import java.io.*;

public class BFStreamIo {

    public static void main(String[] args) throws IOException {
        BufferedInputStream inputStream = null;
        BufferedOutputStream outputStream = null;
        try {
            inputStream = new BufferedInputStream(new FileInputStream("D:\\opt\\def.txt"));
            outputStream = new BufferedOutputStream(new FileOutputStream("D:\\opt\\abc.txt"));
            byte[] bytes = new byte[1024];
            while (inputStream.read(bytes) != -1) {
                outputStream.write(bytes);
            }
            outputStream.flush();
        } catch (IOException e) {

        }finally {
            if (inputStream != null) {
                inputStream.close();
            }
            if (outputStream != null) {
                outputStream.close();
            }
        }

    }
}
